package com.authine.cloudpivot.ext.enums.order;

/**
 * @author Kris
 */
public enum OrderCustomerStatusEnum {
    /**
     * 客户订单状态
     */
    UpcomingPayment("未付款"),
    UpcomingConfirm("未接单"),
    UpcomingDelivery("未发货"),
    DoneDelivery("已发货"),
    Done("已完成"),
    Closed("已关闭");

    public String des;

    OrderCustomerStatusEnum(String des) {
        this.des = des;
    }

    public static OrderCustomerStatusEnum switchNew(Integer status) {
        if (status.equals(1) || status.equals(2) || status.equals(7)) {
            return OrderCustomerStatusEnum.UpcomingPayment;
        }

        if (status.equals(5)) {
            return OrderCustomerStatusEnum.Closed;
        }

        if (status.equals(6)) {
            return OrderCustomerStatusEnum.Done;
        }

        return null;
    }
}
